import axios from '@/libs/api.request'

export class FinanceBasedataApi {
  static get (path, params = {}) {
    return request.get(path, createGETParams(params))
  }

  static post (path, params = {}) {
    return request.post(path, params)
  }

  // 根据条件获取所有信息
  static getList (params) {
    return axios.request({
      url: '/FinanceBasedata/GetList',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 提交财务
  static submit (params) {
    return axios.request({
      url: '/FinanceBasedata/Submit',
      method: 'get',
      enctype: 'multipart/form-data',
      params: params
    })
  }

  // 校验是否已经导出
  static isExport (params) {
    return axios.request({
      url: '/FinanceBasedata/IsExport',
      method: 'get',
      enctype: 'multipart/form-data',
      params: params
    })
  }

  // 导出财务模板
  static export (params) {
    return axios.request({
      url: '/FinanceBasedata/Export',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params,
      responseType: 'blob'
    })
  }

  // 导出安薪税模板
  static exportAxs (params) {
    return axios.request({
      url: '/FinanceBasedata/ExportAxs',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params,
      responseType: 'blob'
    })
  }
  
  // 导出安薪税员工模板
  static exportAxsEmployee (params) {
    return axios.request({
      url: '/FinanceBasedata/ExportAxsEmployee',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params,
      responseType: 'blob'
    })
  }

  // 导入
  static import (params) {
    return axios.request({
      url: '/FinanceBasedata/Import',
      method: 'post',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出模板
  static exportTemplate (params) {
    return axios.request({
      url: '/FinanceBasedata/ExportTemplate',
      method: 'get',
      enctype: 'multipart/form-data',
      data: params
    })
  }

  // 导出错误数据附件
  static exportErrorFile (params) {
    return axios.request({
      url: '/FinanceBasedata/ExportErrorFile',
      method: 'get',
      enctype: 'multipart/form-data',
      data: params
    })
  }
}
